#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<math.h>

int pd(int n)
{	int a = 0;
	int b = 0;
	while (n >=10)
	{
	a = n % 10;
	b = (n / 10) % 10;
	if (b < a)
		n = n / 10;
	else
		return 0;
	}
	return 1;
}

int main()
{
	int i = 0;
	int ret = 0;
	int flag = 0;
	for (i = 32; (int)pow(i, 2) < 10000; i++)
	{
		ret =(int) pow(i, 2);
		flag=pd(ret);
		if (flag)
		{
			printf("%d ", (int)pow(i, 2));
		}

	}
	return 0;
}